﻿<!doctype html>
<html class="no-js" lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
      layout:decorate="~{/layout/layout}">
<head>
<body>
<div id="content" layout:fragment="content">

    <div class="container">
        <div class="row">
            <div class="col-lg-3 col-md-3 hidden-sm hidden-xs">
                <ul class="list-group">
                    <li class="list-group-item">
                        <a href="/user/information" class="list-group-item">
                            个人信息
                        </a>
                    </li>
                    <li class="list-group-item">
                        <a href="/user/to" class="list-group-item">
                            密码修改
                        </a>
                    </li>
                    <li class="list-group-item">
                        <a href="/address/do" class="list-group-item">
                            收货地址
                        </a>
                    </li>
                    <li class="list-group-item">
                        <a href="/ordergroup/order" class="list-group-item">
                            订单管理
                        </a>
                    </li>
                </ul>
            </div>
            <div class="col-lg-6 col-md-6 col-sm-12">

                <!-- <label class="sr-only" for="inputHelpBlock">Input with help text</label>
                    <input type="text" id="inputHelpBlock" class="form-control" aria-describedby="helpBlock"> -->
                <h3>密码修改</h3>
                <form action="/user/modifyPassword" method="post" class="layui-form">
                    <div class="form-group">
                        <div class="form-group">
                            <h4 style="color: #5e5e5e;font-size: 1em;">Email:</h4>
                            <input type="email" id="email" name="email" class="form-control" lay-verify="email"/>
                            <input class="btn btn-primary"
                                   style="width: 105px;float:right; background-color: #337ab7;margin: 0.5em;"
                                   value="发送验证码" id="send"/>
                        </div>
                        <div class="form-group">
                            <h4 style="color: #5e5e5e;font-size: 1em;">验证码:</h4>
                            <input class="form-control" type="text" name="verificationCode" required/>
                        </div>
                        <h4 style="color: #5e5e5e;font-size: 1em;">密码:</h4>
                        <input type="password" class="form-control" name="password" value="" placeholder="密码" required/>
                    </div>
                    <div class="form-group">
                        <h4 style="color: #5e5e5e;font-size: 1em;">确认密码:</h4>
                        <input type="password" class="form-control" name="passwordTow" value="" placeholder="确认密码"
                               required/>
                    </div>

                    <button type="submit" class="btn btn-primary" style="float: right;">保存</button>

                    <input type="checkbox">

                </form>
            </div>
            <div class="col-lg-3 col-md-3 col-sm-12 col-xs-12">


            </div>
        </div>


    </div>

</div>

<script layout:fragment="script">
    var config = {pageTitle: "修改密码", navActive: "navProduct"};
    var cartId = 0;
    $(function () {
        document.title = config.pageTitle;
        $("#" + config.navActive).addClass("active");
    });

    //邮箱验证
    $("#send").click(function () {
        var email = $("#email").val();
        $("#send").attr("value", "正在发送");
        $("#send").attr("disabled", "true");
        $.ajax({
            url: "getEmail",
            type: "POST",
            timeout: 5000,
            data: email,
            contentType: 'application/json;charset=UTF-8',
            async: false,
            success: function (data) {
                $("#send").attr("value", "验证码已发送");
            },
            error: function () {
                alert("请重新输入！");
            }
        });
    });
</script>
</body>
</html>